package com.ybkj.chat.module.dynamic.activity;

import android.support.v7.widget.GridLayoutManager;
import android.view.View;
import android.widget.Button;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ybkj.chat.R;
import com.ybkj.chat.base.BaseMvpActivity;
import com.ybkj.chat.manager.ActivityManager;
import com.ybkj.chat.ui.adapter.AccountAdapter;
import com.ybkj.chat.ui.adapter.PhotoAdapter;
import com.ybkj.chat.ui.adapter.PictureAdapter;
import com.ybkj.chat.ui.adapter.VideoAdapter;
import com.ybkj.chat.ui.view.recyclerview.XRecyclerView;
import com.ybkj.chat.utils.ResourcesUtil;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 附近的人详情页面
 */
public class NearByPeopleDetailsActivity extends BaseMvpActivity {

    //图片列表
    @BindView(R.id.photo_recycle)
    XRecyclerView photoRecycle;
    //相册列表
    @BindView(R.id.picture_recycler)
    XRecyclerView pictureRecycler;
    //视频列表
    @BindView(R.id.video_recycler)
    XRecyclerView videoRecycler;
    //账号升级列表
    @BindView(R.id.account_recycle)
    XRecyclerView accountRecycle;
    //开始会话
    @BindView(R.id.dialogue)
    Button dialogue;

    private PhotoAdapter photoAdapter;
    private PictureAdapter pictureAdapter;
    private VideoAdapter videoAdapter;
    private AccountAdapter accountAdapter;
    @Override
    protected void injectPresenter() {

    }

    @Override
    protected void initTitle() {
        setTitleText("姓名");
        setBackImgVisibility(View.VISIBLE);
        setRightImg(ResourcesUtil.getDrawable(R.drawable.common_nav_btn_more_gray));
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_near_by_people_details;
    }

    @Override
    protected void initView() {
        photoRecycle.setLayoutManager(new GridLayoutManager(mContext, 4));
        photoAdapter = new PhotoAdapter(mContext);
        photoAdapter.addData("1");
        photoAdapter.addData("1");
        photoAdapter.addData("1");
        photoAdapter.addData("1");
        photoAdapter.bindToRecyclerView(photoRecycle);

        pictureRecycler.setLayoutManager(new GridLayoutManager(mContext, 5));
        pictureAdapter = new PictureAdapter(mContext);
        pictureAdapter.addData("1");
        pictureAdapter.addData("1");
        pictureAdapter.addData("1");
        pictureAdapter.addData("1");
        pictureAdapter.addData("1");
        pictureAdapter.bindToRecyclerView(pictureRecycler);

        videoRecycler.setLayoutManager(new GridLayoutManager(mContext, 4));
        videoAdapter = new VideoAdapter(mContext);
        videoAdapter.addData("1");
        videoAdapter.addData("1");
        videoAdapter.addData("1");
        videoAdapter.addData("1");
        videoAdapter.bindToRecyclerView(videoRecycler);
        videoAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                ActivityManager.gotoActivity(mContext, NearByPeopleVideoActivity.class);
            }
        });

        photoAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                ActivityManager.gotoActivity(mContext, LookPictureActivity.class);
            }
        });

        pictureAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                ActivityManager.gotoActivity(mContext, NearByPersonalActivity.class);
            }
        });
        accountAdapter = new AccountAdapter(mContext);
        accountAdapter.addData("1");
        accountAdapter.addData("1");
        accountAdapter.bindToRecyclerView(accountRecycle);
    }

    @Override
    protected void initData() {

    }


    @OnClick(R.id.dialogue)
    public void onViewClicked() {
    }
}
